package com.example.cameralu.app;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Jacky on 2018/3/19
 * desc：
 */

public class AppSharePreferences {

    private static SharedPreferences settings;


    private static SharedPreferences getSP(Context context) {
        return context.getSharedPreferences(AppContacts.EAT_SP, 0);
    }


    public static String getEatThings(Context context) {

        settings = getSP(context);
        return settings.getString(AppContacts.EAT_THINGS, "");
    }

    public static void setEatThings(Context context, String EatThings) {

        settings = getSP(context);
        settings.edit().putString(AppContacts.EAT_THINGS, EatThings).apply();//apply还是 commit看情况把

    }

//
//    public static String getDrinkThings(Context context) {
//
//        settings = getSP(context);
//        return settings.getString(AppContacts.DRINK_THINGS, "");
//    }
//
//    public static void setDrinkThings(Context context, String DrinkThings) {
//
//        settings = getSP(context);
//        settings.edit().putString(AppContacts.DRINK_THINGS, DrinkThings).apply();//apply还是 commit看情况把
//
//    }
//
//
//
//    public static String getPlayThings(Context context) {
//
//        settings = getSP(context);
//        return settings.getString(AppContacts.PALY_THINGS, "");
//    }
//
//    public static void setPlayThings(Context context, String PlayThings) {
//
//        settings = getSP(context);
//            settings.edit().putString(AppContacts.PALY_THINGS, PlayThings).apply();//apply还是 commit看情况把
//
//    }





}
